﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XemPhim;

public partial class Default2 : System.Web.UI.Page
{
    DatPhimDao ve = new DatPhimDao();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadVe();

        }
        
    }

    public void LoadVe()
    {
        GVVE.DataSource=ve.loadVe();
        GVVE.DataBind();

    }

    protected void GVVE_SelectedIndexChanged(object sender, EventArgs e)
    {
        Response.Write(GVVE.SelectedRow.Cells[0].ToString());
    }
    protected void GVVE_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        Response.Write(GVVE.Rows[e.RowIndex].Cells[1].Text);
        int ID = Int32.Parse(GVVE.Rows[e.RowIndex].Cells[1].Text);

        if (CB_trangthai.Checked == true)
        {
            ve.huyVeFix(ID);
        }
        else
        {
            ve.huyVe(ID);
        }
        

    }
}